<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <title>班级管理</title>
    <link rel="stylesheet" type="text/css" href="/thinkphp5/public/static/bootstrap-3.3.5-dist/css/bootstrap.min.css">
</head>

<body class="container">
    <div class="row">
        <div class="col-md-12">
            <hr />
            <div class="row">
                <div class="col-md-8">
                    <form class="form-inline" action="{:url('', input('get.'))}">
                        <div class="form-group">
                            <label class="sr-only" for="name">名称</label>
                            <input name="name" type="text" class="form-control" placeholder="名称..." value="{:input('get.name')}">
                        </div>
                        <button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-search"></i>&nbsp;查询</button>
                    </form>
                </div>
                <div class="col-md-4 text-right">
                    <a href="{:url('add')}" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i>&nbsp;增加</a>
                </div>
            </div>
            <hr />
            <table class="table table-hover table-bordered">
                <tr class="info">
                    <th>序号</th>
                    <th>名称</th>
                    <th>辅导员</th>
                    <th>操作</th>
                </tr>
                {volist name="klasses" id="klass" key="key"}
                <tr>
                    <td>{$key}</td>
                    <td>{$klass->getData('name')}</td>
                    <td>
                        {$klass->Teacher->name}
                    </td>
                    <td><a class="btn btn-danger btn-sm" href="{:url('delete?id=' . $klass->getData('id'))}"><i class="glyphicon glyphicon-trash"></i>&nbsp;删除</a>&nbsp;<a class="btn btn-sm btn-primary" href="{:url('edit?id=' . $klass->getData('id'))}"><i class="glyphicon glyphicon-pencil"></i>&nbsp;编辑</a></td>
                </tr>
                {/volist}
            </table>
            {$klasses->render()}
        </div>
    </div>
</body>

</html>